package com.itbaizhan.controller;

import com.itbaizhan.service.IAccountInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author itbaizhan
 * @since 07-04
 */
@RestController
@RequestMapping("/bank2")
public class AccountInfoController {
    @Autowired
    private IAccountInfoService iAccountInfoService;

    /**
     * 李四账户增加金额
     * @param accountNo 银行卡号
     * @param amount 金额
     * @return 执行结果
     */
    @GetMapping("/transfer")
    public String transfer(String accountNo, Double amount){
        iAccountInfoService.updateAccountBalance(accountNo, amount);
        return "转账成功";
    }

}
